
//---------------------------------------------------------------------------
#include "entities/pg1_quad.h"
//---------------------------------------------------------------------------
#include "rendering/pg1_renderer.h"
//---------------------------------------------------------------------------
#include <d3dx9.h>
//---------------------------------------------------------------------------
using namespace pg1;
//---------------------------------------------------------------------------
Quad::Quad ()
:
Entity2D(),
m_pakVertices( new ColorVertex[4] )
{
	m_pakVertices[0].x = -0.5;	m_pakVertices[0].y = 0.5;	m_pakVertices[0].z = 0.0f;
	m_pakVertices[1].x = 0.5;	m_pakVertices[1].y = 0.5;	m_pakVertices[1].z = 0.0f;
	m_pakVertices[2].x = -0.5;	m_pakVertices[2].y = -0.5;	m_pakVertices[2].z = 0.0f;
	m_pakVertices[3].x = 0.5;	m_pakVertices[3].y = -0.5;	m_pakVertices[3].z = 0.0f;

	m_pakVertices[0].color = PG1_COLOR_ARGB(128,255,0,0);
	m_pakVertices[1].color = PG1_COLOR_ARGB(128,255,0,0);
	m_pakVertices[2].color = PG1_COLOR_ARGB(128,255,0,0);
	m_pakVertices[3].color = PG1_COLOR_ARGB(128,255,0,0);
}
//---------------------------------------------------------------------------
Quad::~Quad ()
{
	delete[] m_pakVertices;
	m_pakVertices = NULL;
}
//---------------------------------------------------------------------------
void Quad::draw (Renderer& rkRenderer) const
{
	rkRenderer.setCurrentTexture(NoTexture);
	rkRenderer.setMatrix( World, transformationMatrix() );
	rkRenderer.draw(m_pakVertices, pg1::TriangleStrip, 4);
}
//---------------------------------------------------------------------------
